<?php

require_once("../../globals.php");
require_once("$srcdir/patient.inc");
require_once("$srcdir/formdata.inc.php");
require_once("$srcdir/formatting.inc.php");
require_once("$srcdir/jsonwrapper/jsonwrapper.php");
require_once("../../globals.php");
require_once("$srcdir/pnotes.inc");
require_once("$srcdir/patient.inc");
require_once("$srcdir/acl.inc");
require_once("$srcdir/log.inc");
require_once("$srcdir/options.inc.php");
require_once("$srcdir/formdata.inc.php");
require_once("$srcdir/classes/Document.class.php");
require_once("$srcdir/gprelations.inc.php");
require_once("$srcdir/formatting.inc.php");
require_once("$srcdir/classes/postmaster.php");


$vars = $_REQUEST;


if($vars['action']=="delete_note"){
	echo "bien";
	echo "<pre>";
	//print_r($vars);
	echo "</pre>";
	$ids = $vars['note_id'];
	//echo $ids;
	$delete_id = explode(";", $ids);
	echo "<pre>";
	//print_r($delete_id);
	echo "</pre>";
        for($i = 0; $i < count($delete_id); $i++) {
			if($delete_id[$i]!=""){
				deletePnote($delete_id[$i]);
				newEvent("delete", $_SESSION['authUser'], $_SESSION['authProvider'], 1, "pnotes: id ".$delete_id[$i]);
				echo "time";
			}          
        }
}


?>